#include <stdio.h>
#include <stdlib.h>
#include <dlfcn.h>

int main()
{ 
    void * handler = dlopen("libmyku.so",RTLD_NOW);
    char *error = dlerror();
    if(error)
    {
       printf("%s\n",error);
       return -1;
    }
    
    double (*f) (double,double);
    f = dlsym(handler,"add2");
    error = dlerror();

    if(error)
    {
       printf("%s\n",error);
       return -1;
    }
    double r = f(2.0,3.0);
    printf("r = %lf\n",r);
    dlclose(handler);
}
